{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "surprised-information",
   "metadata": {},
   "source": [
    "<center><h1>第三次</h1></center>\n",
    "<center>3018233061 樊一飞</center>"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "vietnamese-pizza",
   "metadata": {},
   "source": [
    "## 1.求下列级数的和"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "conditional-glory",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "  2\n",
       "Pi\n",
       "---\n",
       " 6"
      ]
     },
     "execution_count": 1,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Sum[1/n^2,{n,1,Infinity}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "downtown-israeli",
   "metadata": {},
   "outputs": [
    {
     "ename": "Power::infy",
     "evalue": "                    1\nInfinite expression - encountered.\n                    0",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m                                 1\nPower::infy: Infinite expression - encountered.\n                                 0\u001b[0m"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "       1\n",
       "Sum[--------, {n, 1, Infinity}]\n",
       "    n Log[n]"
      ]
     },
     "execution_count": 4,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Sum[1/(n Log[n]),{n,1,Infinity}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "novel-founder",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "       2\n",
       "  2 + x\n",
       "----------\n",
       "       2 2\n",
       "(-2 + x )"
      ]
     },
     "execution_count": 5,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Sum[(2n-1)/2^n x^(2(n-1)),{n,1,Infinity}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "academic-mention",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       " -1 + x\n",
       "---------\n",
       "        2\n",
       "(-2 + x)"
      ]
     },
     "execution_count": 7,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Sum[n(x-1)^n,{n,1,Infinity}]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "simple-hunger",
   "metadata": {},
   "source": [
    "## 2.求下列函数展开成x0点的幂级数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "handled-treatment",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "             2       3       4       5       6       7\n",
       "1 + 4 x + 9 x  + 16 x  + 25 x  + 36 x  + 49 x  + O[x]"
      ]
     },
     "execution_count": 8,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Series[(1+x)/(1-x)^3,{x,0,6}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "liable-volunteer",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "          3    5\n",
       "Pi       x    x        6\n",
       "-- + x - -- + -- + O[x]\n",
       "4        3    5"
      ]
     },
     "execution_count": 9,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Series[ArcTan[(1+x)/(1-x)],{x,0,5}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "nasty-schema",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "           -2            9\n",
       "Log[(1 + x)  ] + O[1 + x]"
      ]
     },
     "execution_count": 10,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Series[Log[1/(1+2x+x^2)],{x,-1,8}]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "casual-florist",
   "metadata": {},
   "source": [
    "## 3.Fourier级数 展开"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "medical-location",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                         1   I                         2   I\n",
       "                         - + -                         - + -\n",
       "-2 - I            I x    2   2      1   I   (2 I) x    9   3      2   I   (3 I) x\n",
       "------ - (2 - I) E    + -------- + (- - -) E        - -------- - (- - -) E        + \n",
       "  I x                    (2 I) x    2   2              (3 I) x    9   3\n",
       " E                      E                             E\n",
       " \n",
       "     1   I                         2    I                         1    I\n",
       "     - + -                         -- + -                         -- + -\n",
       "     8   4      1   I   (4 I) x    25   5     2    I   (5 I) x    18   6\n",
       ">   -------- + (- - -) E        - -------- - (-- - -) E        + -------- + \n",
       "     (4 I) x    8   4              (5 I) x    25   5              (6 I) x\n",
       "    E                             E                              E\n",
       " \n",
       "                         2    I                         1    I\n",
       "                         -- + -                         -- + -\n",
       "     1    I   (6 I) x    49   7     2    I   (7 I) x    32   8     1    I   (8 I) x\n",
       ">   (-- - -) E        - -------- - (-- - -) E        + -------- + (-- - -) E        - \n",
       "     18   6              (7 I) x    49   7              (8 I) x    32   8\n",
       "                        E                              E\n",
       " \n",
       "     2    I                         1    I\n",
       "     -- + -                         -- + --                            2\n",
       "     81   9     2    I   (9 I) x    50   10     1    I    (10 I) x   Pi\n",
       ">   -------- - (-- - -) E        + --------- + (-- - --) E         + ---\n",
       "     (9 I) x    81   9              (10 I) x    50   10               3\n",
       "    E                              E"
      ]
     },
     "execution_count": 34,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Clear[f]\n",
    "f[x_]:=x^2-x;\n",
    "FourierSeries[f[x],x,10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "indian-impact",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "-Graphics-"
      ]
     },
     "execution_count": 35,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Plot[{f[x],%},{x,-.5,.5}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "musical-gauge",
   "metadata": {},
   "outputs": [],
   "source": [
    "Clear[f]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "grave-foster",
   "metadata": {},
   "source": [
    "## 4.展开为正弦级数\n",
    "\n",
    "$f(x)=\\frac{\\pi-x}2$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "written-abortion",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "         Sin[2 x]   Sin[3 x]   Sin[4 x]   Sin[5 x]\n",
       "Sin[x] + -------- + -------- + -------- + --------\n",
       "            2          3          4          5"
      ]
     },
     "execution_count": 37,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "FourierSinSeries[(Pi-x)/2,x,5]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "lightweight-snake",
   "metadata": {},
   "source": [
    "## 5.求下列一阶微分方程的通解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "portable-badge",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "{{y[x] -> -α + C[1] Sin[x]}}"
      ]
     },
     "execution_count": 39,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[y'[x]Tan[x]-y[x]==α,y[x],x]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "permanent-cowboy",
   "metadata": {},
   "outputs": [
    {
     "ename": "Inverse functions are being used by `1`, so some solutions may not be found; use Reduce for complete solution information.",
     "evalue": "Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31mInverse functions are being used by `1`, so some solutions may not be found; use Reduce for complete solution information.: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.\u001b[0m"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                          1\n",
       "{{y[x] -> -ArcCot[------------------]}}\n",
       "                   2 C[1]        x 3\n",
       "                  E       (-1 + E )"
      ]
     },
     "execution_count": 44,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[3E^x Tan[y[x]]+(1-E^x)Sec[y[x]]^2 y'[x]==0,y[x],x]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "extraordinary-triumph",
   "metadata": {},
   "source": [
    "## 6.求下列一阶微分方程满足的初值条件的特解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "decimal-portland",
   "metadata": {},
   "outputs": [
    {
     "ename": "Inverse functions are being used by `1`, so some solutions may not be found; use Reduce for complete solution information.",
     "evalue": "Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31mInverse functions are being used by `1`, so some solutions may not be found; use Reduce for complete solution information.: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.\u001b[0m"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "           Tan[x/2]\n",
       "{{y[x] -> E        }}"
      ]
     },
     "execution_count": 49,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[{y'[x]Sin[x]==y[x] Log[y[x]],y[Pi/2]==E},y[x],x]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "gross-principle",
   "metadata": {},
   "outputs": [
    {
     "ename": "Inverse functions are being used by `1`, so some solutions may not be found; use Reduce for complete solution information.",
     "evalue": "Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31mInverse functions are being used by `1`, so some solutions may not be found; use Reduce for complete solution information.: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.\u001b[0m"
     ]
    },
    {
     "ename": "Inverse functions are being used by `1`, so some solutions may not be found; use Reduce for complete solution information.",
     "evalue": "Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31mInverse functions are being used by `1`, so some solutions may not be found; use Reduce for complete solution information.: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.\u001b[0m"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                   x\n",
       "{{y[x] -> x ArcSin[-]}}\n",
       "                   2"
      ]
     },
     "execution_count": 1,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[{y'[x]==y[x]/x+Tan[y[x]/x],y[1]==Pi/6},y[x],x]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "nutritional-bulgaria",
   "metadata": {},
   "source": [
    "## 7.求下列高阶微分方程的通解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "legitimate-height",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                3\n",
       "           x   x\n",
       "{{y[x] -> E  + -- + C[1] + x C[2]}}\n",
       "               6"
      ]
     },
     "execution_count": 2,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[y''[x]==x+E^x,y[x],x]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "impaired-hundred",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "{{y[x] -> Sqrt[2 x - C[1]] C[2]}}"
      ]
     },
     "execution_count": 3,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[y[x] y''[x]+y'[x]^2 == 0,y[x],x]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cosmetic-avenue",
   "metadata": {},
   "source": [
    "## 8.求下列微分方程初值问题的解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "impressed-chart",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "{{y[x] -> Cos[Pi x] + Sin[Pi x]}}"
      ]
     },
     "execution_count": 1,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[{y''[x]+Pi^2 y[x]==0,y[0]==1,y'[0]==Pi},y[x],x]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "educated-template",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                2 x    2 x      2 x  2\n",
       "          -1 + E    - E    x + E    x\n",
       "{{y[x] -> ----------------------------}}\n",
       "                        x\n",
       "                       E"
      ]
     },
     "execution_count": 3,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[{y''[x]-y[x]==4x E^x,y[0]==0,y'[0]==1},y[x],x]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "coral-causing",
   "metadata": {},
   "source": [
    "## 9.解答\n",
    "求初值问题$\n",
    "\\begin{cases}\n",
    "y'=x^2+y^2\\\\\n",
    "y(0)=1\n",
    "\\end{cases}\n",
    "$在点$x=0.5$处的数值解，并作出图形"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "leading-bolivia",
   "metadata": {},
   "outputs": [],
   "source": [
    "Clear[\"Global`*\"]\n",
    "s = NDSolve[{y'[x]==x^2+y[x]^2,y[0]==1},y[x],{x,0,.9}];\n",
    "y = s[[1,1,2,0]];"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "unnecessary-basin",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "-Graphics-"
      ]
     },
     "execution_count": 57,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Plot[y[x],{x,0,1}]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cooked-madrid",
   "metadata": {},
   "source": [
    "下面是$x=0.5$处的值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "detected-tracker",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><pre style=\"&#102;&#111;&#110;&#116;&#45;&#102;&#97;&#109;&#105;&#108;&#121;&#58;&#32;&#34;&#67;&#111;&#117;&#114;&#105;&#101;&#114;&#32;&#78;&#101;&#119;&#34;&#44;&#67;&#111;&#117;&#114;&#105;&#101;&#114;&#44;&#109;&#111;&#110;&#111;&#115;&#112;&#97;&#99;&#101;&#59;\">&#50;&#46;&#48;&#54;&#55;</pre></div>"
      ],
      "text/plain": [
       "2.067"
      ]
     },
     "execution_count": 58,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y[.5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "acknowledged-school",
   "metadata": {},
   "outputs": [],
   "source": [
    "Clear[\"Global`*\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "brazilian-federation",
   "metadata": {},
   "source": [
    "## 总结\n",
    "### DSolve 需要注意的地方：\n",
    "1. `y`一定要转化为`y[x]`，否则将被识别为单独的变量\n",
    "2. 注意`==`不要输成`=`，否则将被认为是赋值，之后需要 `Clear`"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "scientific-taiwan",
   "metadata": {},
   "source": [
    "## 补充题\n",
    "### 1.级数求积\n",
    "已知$u_n=1+\\frac1{n^5}$,试求$\\prod_{n=1}^5$与$\\prod_{n=1}^{\\infty}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "id": "corrected-vietnam",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "14333231\n",
       "--------\n",
       "6912000"
      ]
     },
     "execution_count": 61,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Product[1+1/n^5,{n,1,5}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "unexpected-gauge",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                                     1\n",
       "---------------------------------------------------------------------------\n",
       "              1/5                2/5                3/5                4/5\n",
       "Gamma[1 - (-1)   ] Gamma[1 + (-1)   ] Gamma[1 - (-1)   ] Gamma[1 + (-1)   ]"
      ]
     },
     "execution_count": 62,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Product[1+1/n^5,{n,1,Infinity}]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "apart-photograph",
   "metadata": {},
   "source": [
    "### 2.求方程组\n",
    "求方程组$\n",
    "\\begin{cases}\n",
    "x^2-y=m\\\\\n",
    "x+y=n\n",
    "\\end{cases}$的根"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "precise-cosmetic",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "       -1 - Sqrt[1 + 4 m + 4 n]       1       Sqrt[1 + 4 m + 4 n]\n",
       "{{x -> ------------------------, y -> - + n + -------------------}, \n",
       "                  2                   2                2\n",
       " \n",
       "          -1 + Sqrt[1 + 4 m + 4 n]       1 + 2 n - Sqrt[1 + 4 m + 4 n]\n",
       ">   {x -> ------------------------, y -> -----------------------------}}\n",
       "                     2                                 2"
      ]
     },
     "execution_count": 63,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Solve[{x^2-y==m,x+y==n},{x,y}]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "designed-samoa",
   "metadata": {},
   "source": [
    "### 3.幂级数展开\n",
    "将$f(x)=\\frac x{x^2+2}$在点$x=-3$做幂级数展开至$n=4$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "opposed-papua",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                             2             3              4\n",
       "  3     7 (3 + x)   9 (3 + x)    23 (3 + x)    237 (3 + x)            5\n",
       "-(--) - --------- - ---------- + ----------- + ------------ + O[3 + x]\n",
       "  11       121         1331         14641         161051"
      ]
     },
     "execution_count": 64,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Series[x/(x^2+2),{x,-3,4}]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "comprehensive-casino",
   "metadata": {},
   "source": [
    "### 4.解方程组\n",
    "$$\n",
    "\\begin{cases}\n",
    "2x'-5y=0\\\\\n",
    "y'+3x=0\n",
    "\\end{cases}\n",
    "$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "exceptional-drilling",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                        15            5                15\n",
       "{{x[t] -> C[1] Cos[Sqrt[--] t] + Sqrt[-] C[2] Sin[Sqrt[--] t], \n",
       "                        2             6                2\n",
       " \n",
       "                           15            6                15\n",
       ">    y[t] -> C[2] Cos[Sqrt[--] t] - Sqrt[-] C[1] Sin[Sqrt[--] t]}}\n",
       "                           2             5                2"
      ]
     },
     "execution_count": 65,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[{2x'[t]-5y[t]==0,y'[t]+3x[t]==0},{x[t],y[t]},t]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "clean-present",
   "metadata": {},
   "source": [
    "### 5.解答\n",
    "已知$y'=y$\n",
    "\n",
    "求（1）方程的通解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "internal-reputation",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "           x\n",
       "{{y[x] -> E  C[1]}}"
      ]
     },
     "execution_count": 66,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[y'[x]==y[x],y[x],x]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "material-christmas",
   "metadata": {},
   "source": [
    "（2）方程满足初始条件$y(0)=4$的特解"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "opposite-halloween",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "             x\n",
       "{{y[x] -> 4 E }}"
      ]
     },
     "execution_count": 67,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "DSolve[{y'[x]==y[x],y[0]==4},y[x],x]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "narrow-stomach",
   "metadata": {},
   "source": [
    "### 6.解答\n",
    "求方程$5y''+3y'+x^3y=0$在区间$[0,10]$上满足条件$y(0)=0,y'(0)=1$的特解，并绘制图形"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "least-houston",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>\n",
       "\t\t\t\t\t\t\t\t\t\t\t\t\t.grid-container {\n",
       "\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay: inline-grid;\n",
       "\t\t\t\t\t\t\t\t\t\t\t\t\t\tgrid-template-columns: auto;\n",
       "\t\t\t\t\t\t\t\t\t\t\t\t\t}\n",
       "\t\t\t\t\t\t\t\t\t\t\t\t</style>\n",
       "\n",
       "\t\t\t\t\t\t\t\t\t\t\t\t<div><div class=\"grid-container\"><div class=\"grid-item\"><img alt=\"Output\" src=\"\"></div><div class=\"grid-item\"><img alt=\"Output\" src=\"\"></div></div></div>"
      ],
      "text/plain": [
       "InterpolatingFunction[{{0., 10.}}, <>]\n",
       "-Graphics-"
      ]
     },
     "execution_count": 81,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = NDSolve[{5y''[x]+3y'[x]+x^3 y[x]==0,y[0]==0,y'[0]==1},y[x],{x,0,10}];\n",
    "y = s[[1,1,2,0]]\n",
    "Plot[y[x],{x,0,10}]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ready-component",
   "metadata": {},
   "source": [
    "### 7.求解\n",
    "求$u_x+u_y=x+y$的通解，并绘制图像"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "eastern-maldives",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "                 2\n",
       "             -3 x  + 2 x y + 2 C[1][-4 x + y]\n",
       "{{u[x, y] -> --------------------------------}}\n",
       "                            2"
      ]
     },
     "execution_count": 115,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Clear[s,y,u]\n",
    "s = DSolve[D[u[x,y],x]+4 D[u[x,y],y]==x+y,u[x,y],{x,y}]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "id": "mounted-husband",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><img alt=\"Output\" src=\"\"></div>"
      ],
      "text/plain": [
       "    2\n",
       "-3 x  + 2 x y + 2 1[-4 x + y]\n",
       "-----------------------------\n",
       "              2"
      ]
     },
     "execution_count": 155,
     "metadata": {
      "text/html": [],
      "text/plain": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s[[1,1,2]]/.C[1]->1"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Wolfram",
   "language": "Wolfram Language",
   "name": "wolframlanguage12.2"
  },
  "language_info": {
   "codemirror_mode": "mathematica",
   "file_extension": ".m",
   "mimetype": "application/vnd.wolfram.m",
   "name": "Wolfram Language",
   "pygments_lexer": "mathematica",
   "version": "12.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
